<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学科信息</title>
    <style>
        body{
            width: 60%;
            margin: auto;
        }
        #container {
            width: 60%;
            margin: 10px auto;
        }
        .user {
            float: right;
            margin-right: 10px;
        }
        .user>a {
            margin-right: 10px;
        }
        #main>dl>dt {
            font-size: 1.5em;
            font-weight: bold;
        }
        #main>dl>dd {
            font-size: 1.2em;
        }
        a {
            text-decoration: none;
            color: darkcyan;
        }
    </style>
</head>
<body>
    <div id="container">
        <div class="user">
            {% if request.session.userid %}
                {{ request.session.username }}
                <a href="/logout/">注销</a>
            {% else %}
                <a href="/login/">用户登录</a>
            {% endif %}
            <a href=/register/>快速注册</a>
        </div>


        </div>
        <h1>课程介绍</h1>
        <hr>
        <div id="main">

            {% for subject in subjects %}
            <dl>
                <dt>
                    <a href="/teachers/?sno={{ subject.no }}">{{ subject.name }}</a>
                    {% if subject.is_hot %}
                    <img src="/static/images/hot-icon-small.png">
                    {% endif %}
                </dt>
                <dd>
                    {{ subject.intro }}
                </dd>
            </dl>
            {% endfor %}

        </div>
    </div>
</body>
</html>